<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:composition template="/templates/form.xhtml">
			<ui:define name="title">SIA Online</ui:define>
			<ui:define name="header">Data Jadwal</ui:define>
			<ui:define name="body">
				<h:form id="data" onkeypress="if(event.keyCode==13)return false;">
					<h:commandButton value="Tambah Jadwal" action="#{jadwal.add}" styleClass="btn btn-sm btn-primary"/>&nbsp;
					<h:commandButton value="Reload Data" action="#{jadwal.reload}" styleClass="btn btn-sm btn-info">
<!-- 						<f:ajax render=":message"/> -->
					</h:commandButton>
					<br/><br/>
					<div class="panel panel-primary">
						<div class="panel-heading">Jadwal Pelajaran Kelas 1</div>
						<div class="panel-body">
							<h:dataTable id="datatable" binding="#{jadwal.htmldatatable}" value="#{jadwal.datatable.dataRows}" var="var" styleClass="table table-bordered table-striped datatable">
								<h:column>
									<f:facet name="header">ID jadwal</f:facet>
									#{var[0]}
								</h:column>
								<h:column>
									<f:facet name="header">Nama Kelas</f:facet>
									#{var[1]}
								</h:column>
								<h:column>
									<f:facet name="header">Mata Pelajaran</f:facet>
									#{var[2]}
								</h:column>
								<h:column>
									<f:facet name="header">Guru</f:facet>
									#{var[3]}
								</h:column>
								<h:column>
									<f:facet name="header">Hari</f:facet>
									#{var[4]}
								</h:column>
								<h:column>
									<f:facet name="header">Action</f:facet>
									<h:outputLink value="#{jadwal.edit()}" styleClass="btn btn-xs btn-warning">
										Edit
										<f:param name="idjadwal" value="#{var[0]}"/>
									</h:outputLink>&nbsp;
									<h:commandButton value="delete" action="#{jadwal.delete}" onclick="if(!confirm('Apakah anda yakin menghapus data ini?'))return false;" styleClass="btn btn-xs btn-danger"/>
								</h:column>
							</h:dataTable>	
						</div>
					</div>
					<div class="panel panel-primary">
						<div class="panel-heading">Jadwal Pelajaran Kelas 2</div>
						<div class="panel-body">
							<h:dataTable id="datatable2" value="#{jadwal.datatable2.dataRows}" var="var" styleClass="table table-bordered table-striped datatable">
								<h:column>
									<f:facet name="header">ID jadwal</f:facet>
									#{var[0]}
								</h:column>
								<h:column>
									<f:facet name="header">Nama Kelas</f:facet>
									#{var[1]}
								</h:column>
								<h:column>
									<f:facet name="header">Mata Pelajaran</f:facet>
									#{var[2]}
								</h:column>
								<h:column>
									<f:facet name="header">Guru</f:facet>
									#{var[3]}
								</h:column>
								<h:column>
									<f:facet name="header">Hari</f:facet>
									#{var[4]}
								</h:column>
								<h:column>
									<f:facet name="header">Action</f:facet>
									<h:outputLink value="#{jadwal.edit()}" styleClass="btn btn-xs btn-warning">
										Edit
										<f:param name="idjadwal" value="#{var[0]}"/>
									</h:outputLink>&nbsp;
									<h:commandButton value="delete" action="#{jadwal.delete}" onclick="if(!confirm('Apakah anda yakin menghapus data ini?'))return false;" styleClass="btn btn-xs btn-danger"/>
								</h:column>
							</h:dataTable>	
						</div>
					</div>
					<div class="panel panel-primary">
						<div class="panel-heading">Jadwal Pelajaran Kelas 3</div>
						<div class="panel-body">
							<h:dataTable id="datatable3" value="#{jadwal.datatable3.dataRows}" var="var" styleClass="table table-bordered table-striped datatable">
								<h:column>
									<f:facet name="header">ID jadwal</f:facet>
									#{var[0]}
								</h:column>
								<h:column>
									<f:facet name="header">Nama Kelas</f:facet>
									#{var[1]}
								</h:column>
								<h:column>
									<f:facet name="header">Mata Pelajaran</f:facet>
									#{var[2]}
								</h:column>
								<h:column>
									<f:facet name="header">Guru</f:facet>
									#{var[3]}
								</h:column>
								<h:column>
									<f:facet name="header">Hari</f:facet>
									#{var[4]}
								</h:column>
								<h:column>
									<f:facet name="header">Action</f:facet>
									<h:outputLink value="#{jadwal.edit()}" styleClass="btn btn-xs btn-warning">
										Edit
										<f:param name="idjadwal" value="#{var[0]}"/>
									</h:outputLink>&nbsp;
									<h:commandButton value="delete" action="#{jadwal.delete}" onclick="if(!confirm('Apakah anda yakin menghapus data ini?'))return false;" styleClass="btn btn-xs btn-danger"/>
								</h:column>
							</h:dataTable>	
						</div>
					</div>
				</h:form>
			</ui:define>
	</ui:composition>
</html>